/*
 * @Author: wangwenshuai 644586996@qq.com
 * @Date: 2022-11-11 21:43:48
 * @LastEditors: wangwenshuai 644586996@qq.com
 * @LastEditTime: 2023-05-16 10:35:15
 * @FilePath: \carbon-pccounting-project\src\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/* * @Author: wangwenshuai  * @Date: 2022-11-Mo 01:52:33 * @Last Modified by:   wangwenshuai * @Last Modified time: 2022-11-Mo 01:52:33 */
/** init domain config */
import "./config";
import Vue from "vue";
import App from "./App.vue";
import Storage from "vue-ls";
import "./registerServiceWorker";
import router from "./router";
import axios from "axios";
import { VueAxios } from "@/utils/request";
import store from "./store";
import Antd, { version } from "ant-design-vue";
import config from "@/defaultSettings";
import dataV from "@jiaminghi/data-view";

// import bus from "@/bus";
import "./assets/iconfont/iconfont.css"; //图标库
import "@/assets/font/Roboto/fonts.scss";
import "@/assets/css/common.css";
import "@/assets/scss/style.scss";

import JDictSelectTag from "@/components/Dict/index.js";
import Components from "@/components/Control/index";
import "@/permission"; // permission control
// import vueBus from '@/utils/vueBus';
import "leaflet/dist/leaflet.css";
import "@/utils/filter"; // base filter
// 引入Leaflet对象 挂载到Vue上，便于全局使用，也可以单独页面中单独引用
import VueAMap from "vue-amap";
Vue.config.productionTip = false;
import echarts from "echarts";
Vue.prototype.$echarts = echarts;
// import VideoPlayer from 'vue-video-player'
// import 'vue-video-player/src/custom-theme.css'
// import 'video.js/dist/video-js.css'
// Vue.use(VideoPlayer)
import _lodash from "lodash";
// import "@/utils/mock.js"
// Vue.use(vueBus);
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/assets/scss/JAreaLinkage.scss";
import VueAreaLinkage from "vue-area-linkage";
import formDesigner from "@/components/formdesigner/components/index.js";
import "@/components/formdesigner/assets/iconfont/iconfont.js";
import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
import Viser from "viser-vue";
Vue.use(Viser);

// 模拟数据
import "@/mock";

Vue.use(formDesigner);
Vue.use(ElementUI);
Vue.prototype.$axios = axios;
//   console.log(VueAxios)
Vue.use(VueAxios, router);
Vue.prototype._lodash = _lodash;
Vue.use(Storage, config.storageOptions);
Vue.use(Components);
Vue.use(Antd);
Vue.use(dataV);
Vue.use(JDictSelectTag);
Vue.use(VueAreaLinkage);
Vue.use(VueAMap);
Vue.directive("title", {
  inserted: function (el) {
    document.title = el.dataset.title;
  },
});

Vue.directive("myfocus", {
  inserted: (el, binding) => {
    if (binding.value == true || binding.value == undefined) {
      var val = el.getAttribute("name");
      if (!val) {
        el.focus();
      }
    }
  },
});

new Vue({
  router,
  store,
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
  render: (h) => h(App),
}).$mount("#app");
